import { ref } from 'vue'

/**公共参数 */
const queryParams = ref<any | null>(null)

export default function useQuery() {
  /** 获取公共参数 */
  const getQueryParams = () => {
    return queryParams.value
  }
  /** 修改公共参数 */
  const setQueryParams = (val: any) => {
    queryParams.value = val
    console.log('修改公共参数', queryParams.value)
  }
  /** 删除公共参数 */
  const deleteQueryParams = () => {
    queryParams.value = null
    console.log('删除公共参数', queryParams.value)
  }
  return {
    queryParams: queryParams.value,
    getQueryParams,
    setQueryParams,
    deleteQueryParams,
  }
}
